<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="common::head-js">
</head>
<body>
<div>
    <!--内容区域-->
    <div class="lr-layout-wrap panel panel-body fa" style="margin: 5px 10px 5px 5px;width: 99%;">
        <div class="lr-layout-title">
            <span id="titleinfo">日志信息</span>
        </div>
        <div class="lr-layout-tool">
            <div class="btn-toolbar">
                <div class="btn-group">
                </div>
                <div class="btn-group">
                </div>
                <div class="btn-group">
                </div>
            </div>
        </div>

        <div class="lr-layout-body" style="padding-left: 30px; padding-top: 28px; min-height: 0px;">
            <div class="mCustomScrollbar">
                <table class="table table-bordered" id="datagridPageExample" style="height: 90%;">
                    <thead>
                    <tr>
                        <th>SESSION</th>
                        <th>请求地址</th>
                        <th>请求类型</th>
                        <th>请求方式</th>
                        <th>状态码</th>
                        <th>请求参数</th>
                        <th>返回数据</th>
                        <th>请求时间</th>
                        <th>返回时间</th>
                        <th>耗时(毫秒)</th>
                        <th>IP地址</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="log:${log}">
                        <td th:text="${log.sessionId}"></td>
                        <td th:text="${log.uri}"></td>
                        <td th:text="${log.type}"></td>
                        <td th:text="${log.method}"></td>
                        <td th:text="${log.httpStatusCode}"></td>
                        <td th:text="${log.paramData}"></td>
                        <td th:text="${log.returnData}"></td>
                        <td th:text="${log.time}"></td>
                        <td th:text="${log.returnTime}"></td>
                        <td th:text="${log.timeConsuming}"></td>
                        <td th:text="${log.clientIp}"></td>
                    </tr>
                    </tbody>
                </table>
                <ul id="myPager" class="pager" data-ride="pager"></ul>
            </div>
        </div>
    </div>
</div>
</body>
<script th:inline="javascript">
    /*<![CDATA[*/
    $vui.Loading("拼命加载中，请稍后...",{overlay:true,timeout:0,icon:"icon icon-spin icon-spinner-indicator"});
    $vui.loadState();
    $('#datagridPageExample').datagrid({
        height:600,
        states: {
            fixedLeftUntil: 1,    // 固定左侧第一列
            fixedRightFrom: 7,   // 从第12列开始固定到右侧
            fixedTopUntil: 1,     // 固定顶部第一行（标题行）
            fixedBottomFrom: [[${page.size}]], // 从第100行（在此例中是最后一行）开始固定到底部
        },
        sortable: true
        });
    $('#myPager').pager({
        page: [[${page.current}]],
        recTotal: [[${page.total}]],
        recPerPage:[[${page.size}]],
        elements:['first_icon', 'prev_icon', 'pages', 'next_icon', 'last_icon', 'goto', 'size_menu', '|', 'items_range_text', 'total_text', 'page_of_total_text'],
        onPageChange: function(state, oldState) {
        },
        linkCreator: function(page, pager) {
            return '/log?current=' + page + '&size=' + pager.recPerPage;
        }
    });
    /*]]>*/
</script>
</html>